package aos.voting.entity;

import java.io.Serializable;

public class Data implements Serializable {
	private static final long serialVersionUID = 1L;
	private int dataId;
	private int version;
	private int value;

	public Data(int dataId) {
		this(dataId, 0, 0);
	}

	public Data(int dataId, int version, int value) {
		this.dataId = dataId;
		this.version = version;
		this.value = value;
	}

	public String toString() {
		return "dataId: " + dataId + " version: " + version + " value: "
				+ value + " ";
	}

	public int getValue() {
		return value;
	}

	public void setValue(int value) {
		this.value = value;
	}

	public void increase(int v) {
		value += v;
		version++;
	}

	public int getVersion() {
		return version;
	}

	public int getDataId() {
		return dataId;
	}

	public void setDataId(int dataId) {
		this.dataId = dataId;
	}

}
